import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:nyh_motorcade_app/pages/card_manage/add_card/add_card_page.dart';
import 'package:nyh_motorcade_app/pages/card_manage/bind_card/bind_card_page.dart';
import 'package:nyh_motorcade_app/pages/card_manage/card_details/card_details_page.dart';
import 'package:nyh_motorcade_app/pages/card_manage/card_manage_page.dart';
import 'package:nyh_motorcade_app/pages/cash_flow/cash_flow/cash_flow_page.dart';
import 'package:nyh_motorcade_app/pages/cash_flow/cash_flow_details/cash_flow_details_page.dart';
import 'package:nyh_motorcade_app/pages/company_manage/company_manage_page.dart';
import 'package:nyh_motorcade_app/pages/company_settlement/account_manage/account_manage_page.dart';
import 'package:nyh_motorcade_app/pages/company_settlement/add_account/add_account_page.dart';
import 'package:nyh_motorcade_app/pages/company_settlement/company_settlement/company_settlement_page.dart';
import 'package:nyh_motorcade_app/pages/company_settlement/payment_result/payment_result_page.dart';
import 'package:nyh_motorcade_app/pages/company_settlement/search_account/search_account_page.dart';
import 'package:nyh_motorcade_app/pages/company_settlement/search_account_manage/search_account_manage_page.dart';
import 'package:nyh_motorcade_app/pages/company_settlement/select_account/select_account_page.dart';
import 'package:nyh_motorcade_app/pages/driver_manage/add_driver/add_driver_page.dart';
import 'package:nyh_motorcade_app/pages/driver_manage/bind_driver/bind_driver_page.dart';
import 'package:nyh_motorcade_app/pages/driver_manage/driver_code/driver_code_page.dart';
import 'package:nyh_motorcade_app/pages/driver_manage/driver_details/driver_details_page.dart';
import 'package:nyh_motorcade_app/pages/driver_manage/driver_manage_page.dart';
import 'package:nyh_motorcade_app/pages/driver_manage/search_driver/search_driver_page.dart';
import 'package:nyh_motorcade_app/pages/home/change_company/change_company_page.dart';
import 'package:nyh_motorcade_app/pages/home/search_company/search_company_page.dart';
import 'package:nyh_motorcade_app/pages/login/login_page.dart';
import 'package:nyh_motorcade_app/pages/login/phone_login/phone_login/phone_login_page.dart';
import 'package:nyh_motorcade_app/pages/main/main_page.dart';
import 'package:nyh_motorcade_app/pages/message/account_amount_remind/account_amount_remind_page.dart';
import 'package:nyh_motorcade_app/pages/message/message_remind/message_remind_page.dart';
import 'package:nyh_motorcade_app/pages/motorcade_manage/motorcade_account/motorcade_account_page.dart';
import 'package:nyh_motorcade_app/pages/motorcade_manage/select_motorcade/select_motorcade_page.dart';
import 'package:nyh_motorcade_app/pages/my/about/about_page.dart';
import 'package:nyh_motorcade_app/pages/my/contact_us/contact_us_page.dart';
import 'package:nyh_motorcade_app/pages/my/cooperate/cooperate_page.dart';
import 'package:nyh_motorcade_app/pages/my/feedback/feedback_page.dart';
import 'package:nyh_motorcade_app/pages/my/privacy_policy/privacy_policy_page.dart';
import 'package:nyh_motorcade_app/pages/my/setting/setting_page.dart';
import 'package:nyh_motorcade_app/pages/preview_photo/preview_photo_page.dart';
import 'package:nyh_motorcade_app/pages/quota/batch_quota/batch_quota_page.dart';
import 'package:nyh_motorcade_app/pages/quota/quota_page.dart';
import 'package:nyh_motorcade_app/pages/rapid_transfer/rapid_transfer_page.dart';
import 'package:nyh_motorcade_app/pages/rapid_transfer/select_transfer_account/select_transfer_account_page.dart';
import 'package:nyh_motorcade_app/pages/splash/splash_page.dart';
import 'package:nyh_motorcade_app/pages/transaction_flow/search_transaction_flow/search_transaction_flow_page.dart';
import 'package:nyh_motorcade_app/pages/transaction_flow/select_date/select_date_page.dart';
import 'package:nyh_motorcade_app/pages/transaction_flow/transaction_flow_details/transaction_flow_details_page.dart';
import 'package:nyh_motorcade_app/pages/transaction_flow/transaction_flow_page.dart';
import 'package:nyh_motorcade_app/pages/vehicle_manage/add_vehicle/add_vehicle_page.dart';
import 'package:nyh_motorcade_app/pages/vehicle_manage/bind_vehicle/bind_vehicle_page.dart';
import 'package:nyh_motorcade_app/pages/vehicle_manage/search_vehicle/search_vehicle_page.dart';
import 'package:nyh_motorcade_app/pages/vehicle_manage/vehicle_details/vehicle_details_page.dart';
import 'package:nyh_motorcade_app/pages/vehicle_manage/vehicle_manage_page.dart';

class Routes {
  static final GlobalKey<NavigatorState> navigatorKey = new GlobalKey<NavigatorState>();

  static const String splash = "/";
  static const String login = "/login";
  static const String phoneLogin = "/phoneLogin";
  static const String privacyPolicy = "/privacyPolicy";
  static const String main = "/main";
  static const String contactUs = "/contactUs";
  static const String feedback = "/feedback";
  static const String setting = "/setting";
  static const String changeCompany = "/changeCompany";
  static const String searchCompany = "/searchCompany";
  static const String companySettlement = "/companySettlement";
  static const String addAccount = "/addAccount";
  static const String selectAccount = "/selectAccount";
  static const String searchAccount = "/searchAccount";
  static const String accountManage = "/accountManage";
  static const String searchAccountManage = "/searchAccountManage";
  static const String paymentResult = "/paymentResult";
  static const String cashFlow = "/cashFlow";
  static const String cashFlowDetails = "/cashFlowDetails";
  static const String previewPhoto = "/previewPhoto";
  static const String transactionFlow = "/transactionFlow";
  static const String searchTransactionFlow = "/searchTransactionFlow";
  static const String selectDate = "/selectDate";
  static const String transactionFlowDetails = "/transactionFlowDetails";
  static const String cardManage = "/cardManage";
  static const String cardDetails = "/cardDetails";
  static const String addCard = "/addCard";
  static const String bindCard = "/bindCard";
  static const String bindDriver = "/bindDriver";
  static const String about = "/about";
  static const String cooperate = "/cooperate";
  static const String rapidTransfer = "/rapidTransfer";
  static const String selectTransferAccount = "/selectTransferAccount";
  static const String driverManage = "/driverManage";
  static const String searchDriver = "/searchDriver";
  static const String addDriver = "/addDriver";
  static const String driverCode = "/driverCode";
  static const String driverDetails = "/driverDetails";
  static const String companyManage = "/companyManage";
  static const String vehicleManage = "/vehicleManage";
  static const String searchVehicle = "/searchVehicle";
  static const String vehicleDetails = "/vehicleDetails";
  static const String addVehicle = "/addVehicle";
  static const String bindVehicle = "/bindVehicle";
  static const String motorcadeAccount = "/motorcadeAccount";
  static const String selectMotorcade = "/selectMotorcade";
  static const String quota = "/quota";
  static const String batchQuota = "/batchQuota";
  static const String messageRemind = "/messageRemind";
  static const String accountAmountRemind = "/accountAmountRemind";

  static final List<GetPage> getPages = [
    GetPage(
      name: splash,
      page: () => SplashPage(),
    ),
    GetPage(
      name: login,
      page: () => LoginPage(),
      transition: Transition.native,
    ),
    GetPage(
      name: phoneLogin,
      page: () => PhoneLoginPage(),
    ),
    GetPage(
      name: privacyPolicy,
      page: () => PrivacyPolicyPage(),
    ),
    GetPage(
      name: main,
      page: () => MainPage(),
      transition: Transition.native,
    ),
    GetPage(
      name: contactUs,
      page: () => ContactUsPage(),
    ),
    GetPage(
      name: feedback,
      page: () => FeedbackPage(),
    ),
    GetPage(
      name: setting,
      page: () => SettingPage(),
    ),
    GetPage(
      name: changeCompany,
      page: () => ChangeCompanyPage(),
    ),
    GetPage(
      name: searchCompany,
      page: () => SearchCompanyPage(),
    ),
    GetPage(
      name: companySettlement,
      page: () => CompanySettlementPage(),
    ),
    GetPage(
      name: addAccount,
      page: () => AddAccountPage(),
    ),
    GetPage(
      name: selectAccount,
      page: () => SelectAccountPage(),
    ),
    GetPage(
      name: searchAccount,
      page: () => SearchAccountPage(),
    ),
    GetPage(
      name: accountManage,
      page: () => AccountManagePage(),
    ),
    GetPage(
      name: searchAccountManage,
      page: () => SearchAccountManagePage(),
    ),
    GetPage(
      name: paymentResult,
      page: () => PaymentResultPage(),
    ),
    GetPage(
      name: cashFlow,
      page: () => CashFlowPage(),
    ),
    GetPage(
      name: cashFlowDetails,
      page: () => CashFlowDetailsPage(),
    ),
    GetPage(
      name: previewPhoto,
      page: () => PreviewPhotoPage(),
    ),
    GetPage(
      name: transactionFlow,
      page: () => TransactionFlowPage(),
    ),
    GetPage(
      name: searchTransactionFlow,
      page: () => SearchTransactionFlowPage(),
    ),
    GetPage(
      name: selectDate,
      page: () => SelectDatePage(),
    ),
    GetPage(
      name: transactionFlowDetails,
      page: () => TransactionFlowDetailsPage(),
    ),
    GetPage(
      name: cardManage,
      page: () => CardManagePage(),
    ),
    GetPage(
      name: cardDetails,
      page: () => CardDetailsPage(),
    ),
    GetPage(
      name: addCard,
      page: () => AddCardPage(),
    ),
    GetPage(
      name: bindCard,
      page: () => BindCardPage(),
    ),
    GetPage(
      name: bindDriver,
      page: () => BindDriverPage(),
    ),
    GetPage(
      name: about,
      page: () => AboutPage(),
    ),
    GetPage(
      name: cooperate,
      page: () => CooperatePage(),
      transition: Transition.native,
    ),
    GetPage(
      name: rapidTransfer,
      page: () => RapidTransferPage(),
    ),
    GetPage(
      name: selectTransferAccount,
      page: () => SelectTransferAccountPage(),
    ),
    GetPage(
      name: driverManage,
      page: () => DriverManagePage(),
    ),
    GetPage(
      name: searchDriver,
      page: () => SearchDriverPage(),
    ),
    GetPage(
      name: driverDetails,
      page: () => DriverDetailsPage(),
    ),
    GetPage(
      name: addDriver,
      page: () => AddDriverPage(),
    ),
    GetPage(
      name: driverCode,
      page: () => DriverCodePage(),
    ),
    GetPage(
      name: companyManage,
      page: () => CompanyManagePage(),
    ),
    GetPage(
      name: vehicleManage,
      page: () => VehicleManagePage(),
    ),
    GetPage(
      name: searchVehicle,
      page: () => SearchVehiclePage(),
    ),
    GetPage(
      name: vehicleDetails,
      page: () => VehicleDetailsPage(),
    ),
    GetPage(
      name: addVehicle,
      page: () => AddVehiclePage(),
    ),
    GetPage(
      name: bindVehicle,
      page: () => BindVehiclePage(),
    ),
    GetPage(
      name: motorcadeAccount,
      page: () => MotorcadeAccountPage(),
    ),
    GetPage(
      name: selectMotorcade,
      page: () => SelectMotorcadePage(),
    ),
    GetPage(
      name: quota,
      page: () => QuotaPage(),
    ),
    GetPage(
      name: batchQuota,
      page: () => BatchQuotaPage(),
    ),
    GetPage(
      name: messageRemind,
      page: () => MessageRemindPage(),
    ),
    GetPage(
      name: accountAmountRemind,
      page: () => AccountAmountRemindPage(),
    ),
  ];

  //无context跳转界面
  static pushNamed({String? routeName, Object? arguments}) {
    if (routeName != null && routeName.isNotEmpty) {
      navigatorKey.currentState!.pushNamed(routeName, arguments: arguments);
    }
  }

  //无context跳转界面(替换)
  static pushReplacementNamed({String? routeName, Object? arguments}) {
    if (routeName != null && routeName.isNotEmpty) {
      navigatorKey.currentState!.pushReplacementNamed(routeName, arguments: arguments);
    }
  }

  //无context跳转并移除其他所有界面
  static pushNamedAndRemoveUntil(String? routeName) {
    if (routeName != null && routeName.isNotEmpty) {
      navigatorKey.currentState!.pushNamedAndRemoveUntil(routeName, (route) => false);
    }
  }
}
